<{*通用文件头*}>
<!doctype html>
<html>
<head>
    <title><{$title}></title>
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="address=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" type="text/css" href="<{$preStaticUrl}>Wap/v2/css/index.css?v=<{$resVersion}>" />
    <script src="<{$preStaticUrl}>Wap/js/jquery-2.1.4.min.js"></script>
    <script src="<{$preStaticUrl}>Wap/v2/js/adaptation.js"></script>
    <script src="<{$preStaticUrl}>Wap/js/common_v2.js?v=<{$resVersion}>"></script>
    <script src="<{$preStaticUrl}>layer_mobile/layer.js"></script>
<script>
    var CurrentPlantform='<{$plantform}>';
</script>
<{if $isWechat }>
<script src=" https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
    wx.config({
    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: '<{$wxSign.appId}>', // 必填，公众号的唯一标识
            timestamp: <{$wxSign.timestamp}>, // 必填，生成签名的时间戳
    nonceStr: '<{$wxSign.nonceStr}>', // 必填，生成签名的随机串
            signature: '<{$wxSign.signature}>',// 必填，签名，见附录1
            jsApiList: [
        'checkJsApi',
        'chooseWXPay',
<{if $isWxShare}>
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
<{/if}>
        'addCard',
        'scanQRCode'
    ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
    });
    <{if $isWxShare}>
    var shareData = {
        title:'<{$wxTitle}>',
        desc: '<{$wxDesc|default:$wxTitle}>',
        link: '<{$wxLink}>',
        imgUrl: '<{$wxImage}>',
        trigger: function (res) {
        // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回
        // alert('用户点击发送给朋友');
        },
        success: function (res) {
            $.getJSON("<{U('User/weixinDayFirstShare')}>",'',function(result){
                console.log(result);
                if(result.status == 0 ){
                    layer.msg(result.tip,{shift:5,offset:$(window).height() * 0.8});
                }
            })
        },
        cancel: function (res) {
            // alert('已取消');
        },
        fail: function (res) {
            // alert(JSON.stringify(res));
        }
    };
    <{/if}>

    var canpay=false;
    wx.ready(function () {

        <{if $isWxShare}>
        wx.onMenuShareAppMessage(shareData);
        wx.onMenuShareTimeline(shareData);
            <{/if}>
<{if $hasUnreceive eq 1}>
        wx.addCard({
            cardList: [{
            cardId:  '<{$wxCardId}>',
            cardExt: '<{$cardExt}>'
        }], // 需要添加的卡券列表
            success: function (res) {
        },
            cancel: function (res) {
        }
        });
<{/if}>
    canpay=true;

    });
</script>
<{/if}>